package com.gitee.loocao.boot.enjoy.autoconfigure;

import org.springframework.boot.autoconfigure.template.AbstractTemplateViewResolverProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "jfinal.enjoy")
public class EnjoyProperties extends AbstractTemplateViewResolverProperties {
    public static final String DEFAULT_TEMPLATE_LOADER_PATH = "/templates/";

    public static final String DEFAULT_PREFIX = "";

    public static final String DEFAULT_SUFFIX = ".html";
    private String baseTemplatePath = DEFAULT_TEMPLATE_LOADER_PATH;
    /**
     * 是否热加载模板文件
     */
    private Boolean devMode = false;
    /**
     * 配置shared function，多文件用逗号分隔
     */
    private String[] sharedFunction;
    /**
     * 是否支持以 #(session.value) 的方式访问 session
     */
    private Boolean sessionInView = false;
    protected EnjoyProperties() {
        super(DEFAULT_PREFIX, DEFAULT_SUFFIX);
    }

    public String getBaseTemplatePath() {
        return baseTemplatePath;
    }

    public void setBaseTemplatePath(String baseTemplatePath) {
        this.baseTemplatePath = baseTemplatePath;
    }

    public Boolean getDevMode() {
        return devMode;
    }

    public void setDevMode(Boolean devMode) {
        this.devMode = devMode;
    }

    public String[] getSharedFunction() {
        return sharedFunction;
    }

    public void setSharedFunction(String... sharedFunction) {
        this.sharedFunction = sharedFunction;
    }

    public Boolean getSessionInView() {
        return sessionInView;
    }

    public void setSessionInView(Boolean sessionInView) {
        this.sessionInView = sessionInView;
    }
}
